home *** CD-ROM | disk | FTP | other *** search
Makefile | 1994-08-02 | 1.9 KB | 59 lines |
- # NOTE:
- # The reason getwd.c is included here is
- # that the libc version has a bug in which it looks at freed
- # memory.
- # This malloc library fills all freed memory with a fill pattern,
- # which causes libc's getwd to fail.
- # When that is fixed for good, we can take getwd.c out of this source,
- # and take out -DGETWD_PATCH from ../Makefile.
-
- include $(ROOT)/usr/include/make/commondefs
-
- LCOPTS = -O2
- LCDEFS = -DGETWD_PATCH
-
- # This is the way for 4.0.5, but they moved it for IRIX 5...
- REAL_LIBMALLOC_TRY_FIRST = /usr/lib/libmpc.a
- REAL_LIBMALLOC = /usr/lib/libmalloc.a
- REAL_LIBMALLOC_OFILES = malloc.o
-
- CFILES = dmalloc.c dmalloc_q.c stacktrace.c stacktrace_s.c malloc.c
- OTHERSOURCE = getwd.o
-
- LDIRT = libdmalloc.-g.a so_locations
- TARGETS = libdmalloc.a libdmalloc.so libdmalloc.-g.so
-
- default all: $(TARGETS)
-
- include $(COMMONRULES)
-
- CLEANOBJECTS = ${OBJECTS}
- GDIRT = ${OBJECTS} a.out core lex.yy.[co] y.tab.[cho] $(_FORCE)
-
- $(REAL_LIBMALLOC_OFILES): $(REAL_LIBMALLOC_TRY_FIRST) $(REAL_LIBMALLOC)
- ar x $(REAL_LIBMALLOC_TRY_FIRST) $(REAL_LIBMALLOC_OFILES) || \
- ar x $(REAL_LIBMALLOC) $(REAL_LIBMALLOC_OFILES)
- @echo "(at most 1 error from the previous command is okay IF you are on IRIX 5)"
- perl -p -i.bak \
- -e "s/\0malloc\0/\0mAlLoC\0/g;" \
- -e "s/\0free\0/\0fReE\0/g;" \
- -e "s/\0realloc\0/\0rEaLlOc\0/g;" \
- -e "s/\0calloc\0/\0cAlLoC\0/g;" \
- -e "s/\0cfree\0/\0cFrEe\0/g;" \
- $(REAL_LIBMALLOC_OFILES) \
- || (rm $(REAL_LIBMALLOC_OFILES) && exit 1)
- rm -f *.bak
-
- libdmalloc.a: $(OBJECTS)
- ar cr libdmalloc.a $(OBJECTS) $(OTHERSOURCE)
-
- libdmalloc.so: libdmalloc.a
- ld -shared -all libdmalloc.a -lmpc -lexc -lmld -lmangle -o libdmalloc.so
-
- libdmalloc.-g.so:
- rm -f stacktrace.o dmalloc.o
- cc -DGETWD_PATCH -c -g dmalloc.c
- cc -DGETWD_PATCH -c -g stacktrace.c
- ar cr libdmalloc.-g.a $(OBJECTS) $(OTHERSOURCE)
- ld -shared -all libdmalloc.-g.a -lmpc -lexc -lmld -lmangle -o libdmalloc.-g.so
-